import { Tooltip } from "../../functionalComponent";
import { iup } from "../../util";
import { jsx as _jsx } from "react/jsx-runtime";
export default function renderLabel(props) {
  var _iup$getPageLang$lang;
  var width = props.width,
    originLabel = props.label,
    langKey = props.langKey,
    labelAlign = props.labelAlign;
  var label = (_iup$getPageLang$lang = iup.getPageLang()[langKey]) !== null && _iup$getPageLang$lang !== void 0 ? _iup$getPageLang$lang : originLabel;
  var labelStyle = {
    width: width,
    display: '-webkit-box',
    textAlign: labelAlign || 'right',
    wordBreak: 'break-all',
    whiteSpace: 'normal',
    maxHeight: '35px',
    lineHeight: 1.25,
    overflow: 'hidden',
    WebkitLineClamp: 2,
    textOverflow: 'ellipsis',
    WebkitBoxOrient: 'vertical'
  };
  return /*#__PURE__*/_jsx(Tooltip, {
    title: label,
    overflow: true,
    placement: "top".concat(labelAlign === 'left' ? 'Left' : 'Right'),
    children: /*#__PURE__*/_jsx("span", {
      style: labelStyle,
      children: label
    })
  });
}